Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for standalone msg variables inside agent python #1111

Merged
merged 2 commits into from
Sep 22, 2023

Conversation

Robadob
Copy link
Member

@Robadob Robadob commented Sep 21, 2023

This change:

  • CodeGen::_Assign() Added a detection when a variable is created via <inputmsg>.at(), adding the variables identifier to self._standalone_message_var.
  • CodeGen::dispatchMemberFunction() Check whether the variable can be found inside self._standalone_message_var, if so treat it similar to an input message iterator.
  • Associated new test case.

Note:
Potential issue that these variables are never removed from the list, e.g. if they should be going out of scope.

Closes #1110

@Robadob Robadob added the bug label Sep 21, 2023
@Robadob Robadob self-assigned this Sep 21, 2023
@Robadob Robadob requested a review from mondus September 21, 2023 12:48
@Robadob Robadob force-pushed the bugfix_agentpython_standalone_msg branch from e91f0ff to e603d0d Compare September 21, 2023 14:26
@@ -752,7 +770,7 @@ def _FunctionDef(self, t):
# check for return annotation type
if not isinstance(t.returns, ast.Name):
self.RaiseError(t, "Agent function conditions return type must be 'bool'")
if t.returns.id is not 'bool':
if t.returns.id != 'bool':
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a weird warning about this, so thought best to fix. Unrelated to PR.

@Robadob Robadob changed the title Draft fix for standalone msg variables inside agent python Fix for standalone msg variables inside agent python Sep 21, 2023
Copy link
Member

@mondus mondus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked in Dev Meeting

@mondus mondus marked this pull request as ready for review September 22, 2023 10:15
@mondus mondus merged commit 87a67f3 into master Sep 22, 2023
18 checks passed
@mondus mondus deleted the bugfix_agentpython_standalone_msg branch September 22, 2023 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent Python MsgArray problems
2 participants